package com.xxx.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * {@link RefreshScope}开启配置刷新
 * @author blijojo
 * @date 2021/5/31
 */
@RestController
@RefreshScope
@Slf4j
public class DemoController {

    @Value("${custom.username}")
    private String username;

    @GetMapping("/test1")
    public String test1(){
        log.info("调用test1服务");
        return "test1 ok! " + username;
    }

}
